<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> 
     <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
	<link rel="stylesheet" href="css/project/style.css">
	<link rel="stylesheet" href="css/zv_common.css">
    <script src="js/zy_control.js"></script>
	<script src="js/zy_click.js"></script>
	<script src="js/zy_json.js"></script>
	<script src="js/main.js"></script>
	<script src="js/init.js"></script>
	<script src="js/talkingdata.js"></script>
	<style>
	body{ background:#fffff;}
	.fightlistl{ background-image:url(images/logo4-1.png); background-size:50%; margin-top:-4.5em; }
	.fightlistr ul { list-style:none; line-height:1.2em; }
	.fightlistfont1{ font-weight:bold; color:#2e2e2e; font-size:1em}
	.fightlistfont2{ color:#5a5a5a; font-size:0.8125em}
	.fightlistfont3{ color:#ae5255; font-size:0.8125em}
	.fightlistfont4{ color:#a2a2a2; font-size:0.8125em}
	.fightlistfont5{ color:#003079; }

	.fightlistfont7{ border-bottom:1px solid  #003079;}
	.fightli{ height:1.6em; line-height:0.8em; width:100%;}
	.fightli1{ height:1.4em; line-height:1.4em; width:100%;}
	.circle {width:14px;height:14px;border:1px #a0a3a6 solid;-webkit-border-radius:10px; margin:0.4em 0.2em;}
	.fightli2{ width:5.6em;}
	.fightli3{ height:3em; line-height:1.4em; width:100%;}
	.font_w{ width:3em;}
	
	
	
	.zv_noticebo{  border-bottom:1px solid #e5e5e5;}
	.zv_noticefont1{height:2.2em;line-height:2.2em;color:#fe0202;font-size:0.925em; overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
	.zv_noticefont2{ height:2.2em;line-height:2.2em;color:#a3a3a3;}
		/*tab切换样式*/
	.uinn-hnfn2{
		padding:0.78em 0;
	}
	</style>
</head>
<body class="um-vp " ontouchstart  id="body">
<div id="page_0" class="up ub ub-ver" tabindex="0"  >		
	<div class="ub c-wh1" id="sliding" style=" position:fixed; top:0;background-color:#E1EAF7;z-index:1; width:100%; height:auto;" >
						<div class="ub ub-ac us-hnfn ub-f1 c-wh1">
							<input class="uhide" type="radio" id="type1" name="type" checked="checked" >
							<div class=" ub-f1 tx-c uinn-hnfn2 ulev0 fontcolor"   id="type1"  style="width:50%"  onmousedown="zy_touch('',zy_for)" ontouchstart="zy_touch('',zy_for)" onclick="important_list('0')">出港</div>
							
							<input class="uhide" type="radio" id="type2" name="type" >
							<div class=" ub-f1 tx-c fontcolor uinn-hnfn2 ulev0"   id="type2" style="width:50%"   onmousedown="zy_touch('',zy_for)" ontouchstart="zy_touch('',zy_for)" onclick="important_list('1')">进港</div>
						</div>
		</div>	
		<div id="top_heght" style="padding:0; margin:0">&nbsp;</div><!-- 滑动高度设置 -->		
		<div class="ub ub-ver" id="important_list" >
			
		</div>
</div>
</body> 
<script>
zy_init();
var titHeight = $$("sliding").offsetHeight;

$$("sliding").style.Height =titHeight;   
$$("top_heght").innerHTML='<div style="padding:0; margin:0; height:'+titHeight+'px;"></div>';
window.uexOnload=function(type){
	if(!type){
		uexWindow.setBounce("0");
		Loading(0);
		important_list(0);
	}
	uexEMM.setEvent("1","{'重要航班通告':'重要航班通告列表'}");
	IC.talkingDataCount("重要航班通告","0012");
}
function important_list(inout){
	Loading(0);
	localStorage.setItem("inout",inout);
	var wsdl = Important_flight_url
    var nameSpace = Important_flight_nameSpace
	var paras = "inout";
	var values =inout;
	var method = Important_flight_function
	currentJosn(wsdl,nameSpace,paras,values,method);	
}
function returnjson(currentJosnStr){
	IC.talkingDataCount("重要航班通告","0012");
		    var  obj = currentJosnStr;
			obj = strToJson(obj);
			
		    var objdata = obj[0].data;
			var strx = "";	
			 if(objdata[0].FlightNo=='')
			 {
			 	
				var height=$$("body").offsetHeight
				var sliding=$$("sliding").offsetHeight
				var b_height=height-sliding
				
				document.getElementById("important_list").innerHTML='<div  style="width:100%; text-align:center;line-height:'+b_height+'px;"><img src="images/nodata.png" style="width:40%; text-align:center;"></div>'
				//$alert("暂无信息",winClose);
			 }
			for(var i=0;i<objdata.length;i++)	
			 {
			
			var FlightNo=objdata[i].FlightNo
			var DeptAirport=objdata[i].DeptAirport
			var ArrAirport=objdata[i].ArrAirport
				
			 	var loginSystem='CeaMG'
				/**时间开始 */				
				var PDate = objdata[i].PDate;
				var time = PDate.split(" ");
				time = time[0];
				time = time.split("/");
				var year=time[0]
				var month=time[1]
				if(month<10)
				{
					month=0+''+month
				}
				var date=time[2]
				if(date<10)
				{
					date=0+''+date
				}
				var flight_date=year+'-'+month+'-'+date
				/**时间结束 */	
				var character= objdata[i].FlightNo;
				var carrier= character.substr(0,2);
				var flight_no= character.substr(2);
				var dep_airport= objdata[i].DeptAirportCode;
				var arr_airport = objdata[i].ArrAirportCode;
				var wsdl =Important_flight_jump_url
				var nameSpace = Important_flight_jump_nameSpace
				var paras = "loginSystem|flight_date|carrier|flight_no|dep_airport|arr_airport";
				var values = loginSystem+'|'+flight_date+'|'+carrier+'|'+flight_no+'|'+dep_airport+'|'+arr_airport
				var method = Important_flight_jump_function
				var jsonPage =[{'key':'wsdl','type':'0','value':wsdl},{'key':'KEY1','type':'0','value':'1'},{'key':'KEY2','type':'0','value':'1'}, {'key':'KEY3','type':'0','value':'1'}, {'key':'nameSpace','type':'0','value':nameSpace}, {'key':'method','type':'0','value':method}, {'key':'paras','type':'0','value':paras}, {'key':'values','type':'0','value':values}];
			$.getJSON(UrlClient+"&SOAPType=yes",function(json){
						var  obj = currentJosnStr;
		                        //var JosnStr = JSON.stringify(json);
								//alert(JSON.stringify(json));
								//JosnStr=JosnStr.replace(/\{/g, '[{') 
								//JosnStr=JosnStr.replace(/\}/g, '}]') 
								//JosnStr = strToJson(JosnStr);
								var JosnStr=json.Data.Item.ActualFlights.ActualFlight
					var PLAN_DEPT_TIME = JosnStr.PLAN_DEPT_TIME
					PLAN_DEPT_TIME = PLAN_DEPT_TIME.split(" ");
					PLAN_DEPT_TIME=PLAN_DEPT_TIME[1]
					PLAN_DEPT_TIME = PLAN_DEPT_TIME.split(":");
					PLAN_DEPT_TIME=PLAN_DEPT_TIME[0]+':'+PLAN_DEPT_TIME[1]//计划起飞
					
					var PLAN_ARR_TIME = JosnStr.PLAN_ARR_TIME
					PLAN_ARR_TIME = PLAN_ARR_TIME.split(" ");
					PLAN_ARR_TIME=PLAN_ARR_TIME[1]
					PLAN_ARR_TIME = PLAN_ARR_TIME.split(":");
					PLAN_ARR_TIME=PLAN_ARR_TIME[0]+':'+PLAN_ARR_TIME[1]//计划降落
					
					
					var REAL_DEPT_TIME = JosnStr.REAL_DEPT_TIME//实际起飞
					var actual='实飞'
					if (REAL_DEPT_TIME == "" || REAL_DEPT_TIME == "undefined" || REAL_DEPT_TIME == undefined)//实际起飞
					{
						REAL_DEPT_TIME =  JosnStr.EST_DEPT_TIME
						actual='预飞'
					}
					REAL_DEPT_TIME = REAL_DEPT_TIME.split(" ");
					REAL_DEPT_TIME=REAL_DEPT_TIME[1]
					REAL_DEPT_TIME = REAL_DEPT_TIME.split(":");
					REAL_DEPT_TIME=REAL_DEPT_TIME[0]+':'+REAL_DEPT_TIME[1]//实际/预计起飞
					
					var REAL_ARR_TIME = JosnStr.REAL_ARR_TIME//实际降落
					var actuale='实到'
					if (REAL_ARR_TIME == "" || REAL_ARR_TIME == "undefined" || REAL_ARR_TIME == undefined)//实际降落
					{
						REAL_ARR_TIME =  JosnStr.EST_ARR_TIME
						actuale='预到'
					}
					REAL_ARR_TIME = REAL_ARR_TIME.split(" ");
					REAL_ARR_TIME=REAL_ARR_TIME[1]
					REAL_ARR_TIME = REAL_ARR_TIME.split(":");
					REAL_ARR_TIME=REAL_ARR_TIME[0]+':'+REAL_ARR_TIME[1]//实际/预计降落
					strx += '<div class="ub ubb fightlistfont7" ontouchstart="zy_touch(\'zvbtn-act\')"  onclick="openWidget(\''+JosnStr.CARRIER+JosnStr.FLIGHT_NO+'\',\''+JosnStr.FLIGHT_DATE+'\',\''+JosnStr.PLAN_DEPT_AIRPORT_3_CODE+'\',\''+JosnStr.PLAN_ARR_AIRPORT_3_CODE+'\')">'
	 				strx += '<div class="umw2 fightlistl ub-img"></div>'
	 				strx += '<div class="ub-f1 ub">'
	 				strx += '<ul class="ub-pc">'
	 				strx += '<li class="ub ub-ac fightli">'
            		strx += '<div class="umw4 fightlistfont1">'+JosnStr.CARRIER+JosnStr.FLIGHT_NO+'</div>'
                	strx += '<div class="ub-f1 fightlistfont2">'
                	strx += '<div style=" width:11em;">'+JosnStr.AC_TYPE+'</div>'
               	 	strx += '</div>'
                	strx += '<div class="umw4 fightlistfont3 umar-r">'+JosnStr.FLIGHT_DATE+'</div>'
            		strx += '</li>'
            		strx += '<li class="ub ub-ac fightli1">'
            		strx += '<div class="umw4 fightlistfont2 ulev-1 tx-c"  style="width:22%">'+JosnStr.DEPT_AIRPORT_ZHS+'</div>'
                	strx += '<div style="width:56%">'
                	strx += '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="10%" align="center"><div class="circle"></div></td><td  width="90%" align="center"><div style=" height:0.1em; width:100%; border-bottom:1px dotted #a0a3a6;"></div></td><td width="10%" align="center"><div class="circle"></div></td></tr></table>'
                	strx += '</div>'
                	strx += '<div class="umw4 fightlistfont2 ulev-1 tx-c"  style="width:22%" >'+JosnStr.ARR_AIRPORT_ZHS+'</div>'	
            		strx += '</li>'
					strx += '<li  class="ub ub-ac fightli3">'
            		strx += '<div class="umw4 fightlistfont4 ulev-1 ub ub-ver">'
                	strx += '<div>计飞 '+PLAN_DEPT_TIME+'</div>'
                    strx += '<div>'+actual+' <span class="fightlistfont5">'+REAL_DEPT_TIME+' </span></div>'
               	 	strx += '</div>'
                	strx += '<div class="ub ub-f1 fightlistfont2 ub  tx-c">'
                	strx += '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td  align="center"><div style=" height:2em; width:33%; line-height:2em; padding:0.5em width:4em; border:1px solid #3fa33f;text-align:center;">'+JosnStr.STATUS+'</tr></td></div></table>'
                	strx += '</div>'
                	strx += '<div class="tx-l fightli2 fightlistfont4 ulev-1 ub ub-ver">'
                	strx += '<div>计到 '+PLAN_ARR_TIME+'</div>'
                     strx += '<div>'+actuale+' <span class="fightlistfont5">'+REAL_ARR_TIME+' </span></div>'
                	strx +=	'</div>'
           			strx += '</li>'
	 				strx += '</ul>'
					strx += '</div>'
					strx += '</div>'	
					
				
					$$("important_list").innerHTML=strx;
					
					
		            },"json",function(e){},"POST",jsonPage,false);

			 }
			
			
			Loading(-1);
			
}
/**
        * 子widget结束后，在主widget的回调方法
        * 注意：只有在主窗口中，才能监听到子Widget的回调；浮动窗口打开子Widget监听不到结束回调
        * @param {string} msg
*/
function backToCallBackFun(msg){
	//console.log("从子widget返回是传递的数据："+msg);
}
function openWidget(FLIGHT_NO,FLIGHT_DATE,PLAN_DET_AIRPORT,PLAN_ARR_AIRPORT){
	IC.talkingDataCount("重要航班通告","0012");
	Loading(0);
	//alert(FLIGHT_NO);
	//localStorage.setItem("setImportantFlight","callFlight");//对方首页判断当setImportantFlight为“callFlight”的时候调用航班详情页面
	//localStorage.setItem("FLIGHT_NO",FLIGHT_NO);//航班号
	//localStorage.setItem("FLIGHT_DATE",FLIGHT_DATE);//日期
	//localStorage.setItem("PLAN_DET_AIRPORT",PLAN_DET_AIRPORT);//起飞城市3字码
	//localStorage.setItem("PLAN_ARR_AIRPORT",PLAN_ARR_AIRPORT);//降落城市3字码
	
	
//http://mobile-amdev.ceair.com:8080/AirMobileControlRS2/GetFlightInfoId.ashx?flightBJDate=2014-10-31&flightNo=MU5138&deptAirport=PEK&arrAirport=SHA
	$.getJSON("http://mobile-amdev.ceair.com:8080/AirMobileControlRS2/GetFlightInfoId.ashx?flightBJDate="+FLIGHT_DATE+"&flightNo="+FLIGHT_NO+"&deptAirport="+PLAN_DET_AIRPORT+"&arrAirport="+PLAN_ARR_AIRPORT+"", function(json){
		    var msg = '{"page":"flyInfo_win","popover":"flyInfo_basic","flightInfoId":"'+json+'","returnService":1}';
//{"page":"flyInfo_win","popover":"flyInfo_basic","flightInfoId":"70743746","returnService":1}
			//uexWidget.startWidget("11219621",0,"backToCallBackFun",msg,"250","4bee1314-6109-4606-a3ac-bb5f569218d4");//正式
			uexWidget.startWidget("11358569",0,"backToCallBackFun",msg,"250","9fe4ea4b-0ccf-4738-8123-ee8f3e0246f0");//测试版本
		Loading(-1);
		});
	
	
	
	// http://mobile-amdev.ceair.com:8080/AirMobileControlRS2/JsonService/
	
}
</script>
</html>
